import 'package:json_annotation/json_annotation.dart';
import 'package:lovify/models/enums/relationship_status.dart';
import 'package:lovify/models/user.dart';
import 'base_entity.dart';

part 'relationship.g.dart';

@JsonSerializable(explicitToJson: true)
class Relationship extends BaseEntity {
  final User? userFrom;
  final User? userTo;
  final RelationshipStatus? status;
  final double? distance;

  Relationship({
    super.id,
    super.created,
    super.updated,
    super.deleted,
    this.userFrom,
    this.userTo,
    this.status,
    this.distance,
  });

  factory Relationship.fromJson(Map<String, dynamic> json) =>
      _$RelationshipFromJson(json);

  @override
  Map<String, dynamic> toJson() => _$RelationshipToJson(this);
}
